import axios from "axios"
import qs from 'qs'
import {prefix} from "./index";
const headers = {
    'Content-Type': 'application/x-www-form-urlencoded'
}
export const showOrder = async (pageParam) => {
    let response = await axios({
        method: "get",
        url: prefix +"/orders" ,
        params: pageParam
    })
    return response.data;
}
export const delOrder = async (orderId) => {
    let response = await axios({
        method: "delete",
        url: prefix + "/orders/"+orderId,
    })
    return response.data;
}
export const findByOrder = async (orderId) => {
    let response = await axios({
        method: "get",
        url: prefix + "/orders/"+orderId,
    })
    return response.data;
}
export const buy = async (user) => {
    let response = await axios({
        method: "post",
        url: prefix + "/orders",
        data:user
    })
    
    return response.data;
}

